/**
 * Created by chenjinzhuan on 15-1-14.
 */
'use strict';

angular.module('backofficeApp.shortMessageManager.services', ['ngResource']).
    factory('shortMessageManager', function ($resource) {
        return $resource('http://'+backOfficeHost+'/rest/v1.0/backoffice/Systems/:action',
            {
                //objId: "@objId"   //@会在传入的对象中读取相应的属性，对象是从controller中传来的
            },
            {
                getShortMessageList:{
                    method: 'GET',
                    params: {
                        action: 'getShortMessageList'
                    },
                    headers: {
                        'Content-Type': 'application/json'
                    }
                },
                searchShortMessage:{
                    method: 'POST',
                    params: {
                        action: 'searchShortMessage'
                    },
                    headers: {
                        'Content-Type': 'application/json'
                    }
                }
            }
        );
    }).factory('chatMessageManager', function ($resource) {//TODO:环信聊天记录
        return $resource('http://'+backOfficeHost+'/rest/v1.0/backoffice/Systems/:action',
            {
                //objId: "@objId"   //@会在传入的对象中读取相应的属性，对象是从controller中传来的
            },
            {
                getChatMessageList:{//modify
                    method: 'GET',
                    params: {
                        action: 'getChatMessageList'//TODO,test
                    },
                    headers: {
                        'Content-Type': 'application/json'
                    }
                },
                searchChatMessage:{
                    method: 'POST',
                    params: {
                        action: 'searchChatMessage'//TODO：改成环信的接口
                    },
                    headers: {
                        'Content-Type': 'application/json'
                    }
                }
            }
        );
    });
